import React , {Suspense,lazy}from 'react'
import {Link,Route,Routes} from 'react-router-dom'
// import List from './pages/list/index'
// import Home from './pages/home/home'

const List = lazy(()=>import(/*webpackChunkName:'home'*/'./pages/list/index'))
const Home = lazy(()=>import(/*webpackChunkName:'list'*/'./pages/home/home'))
function App () {
    return <div>
        <h1>App</h1>
        {/* <Home></Home> */}
        <ul>
            <li><Link to="/home">Home</Link></li>
            <li><Link to="/list">list</Link></li>
        </ul>
       <Suspense fallback={<h1>加载中...</h1>}>
            <Routes>
                <Route path='/home' element = {<Home />}></Route>
                <Route path='/list' element = {<List />}></Route>
            </Routes>
       </Suspense>
    </div>
}
export default App